<template>
	<el-drawer title="督查督办详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="事件标题" prop="title">{{form.title}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="事件类型" prop="type">{{form.typeName}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="事件等级" prop="levelId">{{form.levelName}}</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="督查领导" prop="leadId">{{form.leadUserName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="牵头人" prop="handedUser">{{form.handedUserName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="开始时间" prop="beginTime">{{form.beginTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="结束时间" prop="endTime">{{form.endTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="参与人员" prop="joinUserName">{{form.joinUserName}}</el-form-item>
					<el-form-item label="任务内容">
						<div v-html="form.remark"></div>
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				supervisionId:'',
				title: '',
				typeName: '',
				levelName: '',
				leadUserName:"",
				handedUser:"",
				beginTime:'',
				endTime:'',
				joinUserName: '',
				remark: '',
				attachId:'',
				msgType:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		setData(data){
			this.form.supervisionId = data.supervisionId
			this.form.title = data.title
			this.form.typeName = data.typeName
			this.form.levelName = data.levelName
			this.form.leadUserName = data.leadUserName
			this.form.handedUserName = data.handedUserName
			this.form.beginTime = data.beginTime
			this.form.endTime = data.endTime
			this.form.joinUserName = data.joinUserName
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
		async getSupervisionById(data)
		{
			let res = await this.$API.supervision.supervision.getSupervisionById.get({supervisionId:data});
			{
				if(res.code==200)
				{
					this.form.supervisionId = res.data.supervisionId
					this.form.title = res.data.title
					this.form.typeName = res.data.typeName
					this.form.levelName = res.data.levelName
					this.form.leadUserName = res.data.leadUserName
					this.form.handedUserName = res.data.handedUserName
					this.form.beginTime = res.data.beginTime
					this.form.endTime = res.data.endTime
					this.form.joinUserName = res.data.joinUserName
					this.form.attachId = res.data.attachId
					this.form.remark = res.data.remark
				}else
				{
					this.$alert(res.message, "提示", {type: 'error'})
				}
			}
		}
	}
}
</script>

<style>
</style>
